<?php
use yii\helpers\Url;
use frontend\widgets\hot\HotWidget;

$this->title = $data['title'];
$this->params['breadcrumbs'][] = ['label'=>'文章','url'=>['posts/index']];
$this->params['breadcrumbs'][] = $data['title'];

?>

<div class="row">
    <div class="col-lg-9">
        <div class="page-title">
             <h1><?= $data['title'];?></h1>
            <span>作者：<?= $data['user_name'];?></span>
            <span>发布：<?= date('Y-m-d H:i:s',$data['created_at']);?></span>
            <span>浏览：<?= $data['extend']['browser']?:0;?> 次</span>
        </div>

        <div class="page-content"><?=$data['content'];?></div>

        <div class="page-tag">
            标签：
            <?php foreach ($data['tags'] as $tag):?>
                <span><a href="#"><?=$tag;?></a></span>
            <?php endforeach;?>

        </div>
    </div>
    <div class="col-lg-3">
<!--        <a href="--><?//=Url::to(['posts/create'])?><!--"><button class="btn btn-warning no-radius btn-sm pull-left">创建文章</button></a>-->
        <div class="panel">
            <a href="<?=Url::to(['posts/create'])?>"><button class="btn btn-warning no-radius btn-sm pull-full">创建文章</button></a>
            <?php if($data['is_edit']):?>
            <a href="<?=Url::to(['posts/edit','id'=>$data['id']])?>"><button class="btn btn-warning no-radius btn-sm pull-full">编辑文章</button></a>
            <?php endif;?>
        </div>
        <div class="panel">
            <!--热门浏览组件调用-->
            <?=HotWidget::widget();?>
        </div>
    </div>
</div>

